/*!
    \copyright  Copyright (c) 2024 Qualcomm Technologies International, Ltd.
                All Rights Reserved.
                Qualcomm Technologies International, Ltd. Confidential and Proprietary.
    \file
    \addtogroup handset_service
    @{
    \brief
*/

#ifndef HANDSET_SERVICE_ACCEPTOR_LIST_H
#define HANDSET_SERVICE_ACCEPTOR_LIST_H

#include <bdaddr.h>


/*! \brief Initialise the acceptor list module.
*/
void handsetService_AcceptorListInit(void);

/*! \brief Set the maximum number of handsets allowed in the acceptor list.

    \param[in] max_handset_count
*/
bool handsetService_AcceptorListSetMaximumHandsetCount(unsigned max_handset_count);

/*! \brief Get the current number of handsets in the acceptor list.

    \return The number of handsets in the acceptor list.
*/
unsigned handsetService_AcceptorListGetHandsetCount(void);

/*! \brief Add a paired handset to the acceptor list.

    Reasons the handset can fail to be added to the list:
        List is full
        Handset has a random address which cannot be resolved

    If tpaddr is a LE address and is resolvable to an Identity address then
    this function will try to match the Identity address to a handset already
    in the list before adding it as a new entry.

    \param[in] tpaddr The BT address of the paired handset.

    \return TRUE if the handset was added to the acceptor list; FALSE otherwise.
*/
bool handsetService_AcceptorListAddHandset(const tp_bdaddr *tpaddr);

/*! \brief Determine if a given handset can be added to the acceptor list.
    \return TRUE if the handset can be added to the acceptor list, FALSE otherwise.
*/
bool handsetService_AcceptorListCanAddHandset(const tp_bdaddr *tpaddr);

/*! \brief Remove a paired handset from the acceptor list.

    Reasons the handset can fail to be removed from the list:
        Address doesn't match any handset in the list.

    \param[in] tpaddr The BT address of the paired handset.
*/
void handsetService_AcceptorListRemoveHandset(const tp_bdaddr *tpaddr);

/*! \brief Remove all handsets from the acceptor list. */
void handsetService_AcceptorListRemoveAllHandsets(void);

/*! \brief Attempt to sanitise the acceptor list by resolving random addresses. */
void handsetService_AcceptorListSanitise(void);

#endif /* HANDSET_SERVICE_ACCEPTOR_LIST_H */
/*! @} */
